package com.fz.us.admin.company.entity;


import javax.persistence.*;
import java.util.List;

/**
 * 步骤简要表
 * Created by ZhuChunXiao on 2017/4/11.
 */
@Entity
@Table(name="sys_stepbrief")
public class StepBrief  extends CompanyEntity {

    private static final long serialVersionUID = -4827447950183472096L;

    /**
     * 步骤编号
     */
    private int stepNo;
    /**
     * 下一步步骤编号
     */
    private int nextStepNo;

    /**
     * 路由类型，1一般路由，2条件路由
     */
    private int routeType;

    /**
     * 条件列表
     */
    private List<StepCon> stepConList;

    /**
     * 是否会签
     */
    private boolean jointlySing;
    /**
     * 特殊设定包含
     * 上一步操作用户-职权上级 1
     * 上一步操作用户所属部门负责人 2
     * 上一步操作用户所属部门的上级部门负责人 3
     */
    private String specialType;


    /**
     * 流程简要表
     */
    private ProcessBrief processBrief;

    /**
     * 通用配置
     */
    private CommonConfig commonConfig;

    /**
     * 操作设置
     * 包含
     * 允许否决 2
     * 允许退回 1
     */
    private String actionType;

    /**
     * 退回步骤
     */
    private int backStepNo;


    public int getStepNo() {
        return stepNo;
    }

    public void setStepNo(int stepNo) {
        this.stepNo = stepNo;
    }

    public int getNextStepNo() {
        return nextStepNo;
    }

    public void setNextStepNo(int nextStepNo) {
        this.nextStepNo = nextStepNo;
    }

    public int getRouteType() {
        return routeType;
    }

    public void setRouteType(int routeType) {
        this.routeType = routeType;
    }

    @Column(columnDefinition = "tinyint(1) default 0")
    public boolean isJointlySing() {
        return jointlySing;
    }

    public void setJointlySing(boolean jointlySing) {
        this.jointlySing = jointlySing;
    }

    public String getSpecialType() {
        return specialType;
    }

    public void setSpecialType(String specialType) {
        this.specialType = specialType;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public ProcessBrief getProcessBrief() {
        return processBrief;
    }

    public void setProcessBrief(ProcessBrief processBrief) {
        this.processBrief = processBrief;
    }

    @OneToOne(cascade=CascadeType.ALL)
    public CommonConfig getCommonConfig() {
        return commonConfig;
    }

    public void setCommonConfig(CommonConfig commonConfig) {
        this.commonConfig = commonConfig;
    }

    @OneToMany(mappedBy = "stepBrief", fetch =FetchType.LAZY )
    public List<StepCon> getStepConList() {
        return stepConList;
    }

    public void setStepConList(List<StepCon> stepConList) {
        this.stepConList = stepConList;
    }

    public String getActionType() {
        return actionType;
    }

    public void setActionType(String actionType) {
        this.actionType = actionType;
    }

    public int getBackStepNo() {
        return backStepNo;
    }

    public void setBackStepNo(int backStepNo) {
        this.backStepNo = backStepNo;
    }
}
